package com.yx.fx.log.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 日志对象
 *
 * @author 杨智杰
 * @since 2021/8/11 10:58
 */
@Data
@Accessors(chain = true)
@TableName(value = "sys_logger")
public class Logger implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键Id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("请求方式")
    @TableField("method")
    private String method;

    @ApiModelProperty("请求路径")
    @TableField("request_uri")
    private String requestURI;

    @ApiModelProperty("请求参数")
    @TableField("query_string")
    private String queryString;

    @ApiModelProperty("请求body")
    @TableField("request_body")
    private String requestBody;

    @ApiModelProperty("响应body")
    @TableField("response_body")
    private String responseBody;

    @ApiModelProperty("客户端主机名或IP")
    @TableField("remote_host")
    private String remoteHost;

    @ApiModelProperty("请求协议类型")
    @TableField("scheme")
    private String scheme;

    @ApiModelProperty("请求协议类型以及版本")
    @TableField("protocol")
    private String protocol;

    @ApiModelProperty("请求概略信息")
    @TableField("request_url")
    private String requestURL;

    @ApiModelProperty("请求头信息")
    @TableField("headers")
    private String headers;

    @TableField("answer")
    @ApiModelProperty("响应时长(毫秒)")
    private Long answer;

    @TableField(value = "create_time")
    @ApiModelProperty("创建时间")
    private String createTime;

}

